<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Private Messages</title>
    </h:head>
    <h:body>
        <ui:composition template="/Template/newTemplate.xhtml">
            <ui:define name="content">
                <h:form>
                    <p:dataTable value="#{privatemessageBean.fromUsers}" var="m" paginator="true" 
                                 rows="10" rowsPerPageTemplate="5,10,15" paginatorPosition="bottom">
                        <f:facet name="header">Message To You</f:facet>
                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Title" />  
                            </f:facet>
                            <h:commandLink action="gotomessage" value="#{m.title}">
                                <f:setPropertyActionListener target="#{displayMessageBean.id}" value="#{m.id}"/>
                            </h:commandLink>
                        </p:column>
                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="From" />  
                            </f:facet>  
                            <h:outputText value="#{m.fromUser}" />  
                        </p:column>
                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Date" />  
                            </f:facet>  
                            <h:outputText value="#{m.date}" />  
                        </p:column>
                    </p:dataTable>
                </h:form>
                <h:form>
                    <p:dataTable value="#{privatemessageBean.toUsers}" var="m" paginator="true" 
                                 rows="10" rowsPerPageTemplate="5,10,15" paginatorPosition="bottom">
                        <f:facet name="header">Message From You</f:facet>
                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Title" />  
                            </f:facet>  
                            <h:commandLink action="gotomessage" value="#{m.title}">
                                <f:setPropertyActionListener target="#{displayMessageBean.id}" value="#{m.id}"/>
                            </h:commandLink>  
                        </p:column>
                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="To" />  
                            </f:facet>  
                            <h:outputText value="#{m.toUser}" />  
                        </p:column>
                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Date" />  
                            </f:facet>  
                            <h:outputText value="#{m.date}" />  
                        </p:column>
                    </p:dataTable>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

